const express = require('express');
const router = express.Router();
const fs = require("fs");
const path = require("path");

router.get("/", function (req, res) {
    try {
        let error_log_stream = fs.createReadStream(
            path.join("/", "error.log")
        );
        error_log_stream.on("error",(err)=>{
            res.send(err);
        })

        error_log_stream.pipe(res);
    }catch(e){
        res.send(e);
    }
})

module.exports = router;